package com.hns.phone.service.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.hns.can.common.vo.CommonParamsVo;
import com.hns.frame.service.CommonService;
import com.hns.phone.service.vo.PhoneDrivingRecordAnalysisVo;
import com.hns.tool.pub.PubUtil;

/**
 * 车辆运行状态service
 * @author:zhangy
 * @email:zhangyu2222z@sina.cn
 * @version Revision 2.0.0
 */
@Service
public class PhoneMotionStatusService extends CommonService {
	/**
	 * 行驶记录分析
	 * @param vo
	 * @return
	 * @author:zhangy
	 * @email:zhangyu2222z@sina.cn
	 */
	@SuppressWarnings({ "unchecked", "rawtypes" })
	public List getDrivingRecordAnalysis(CommonParamsVo params) {
		List list = PubUtil.convertListMapToObject(
				this.sqlMapDao.selectList("phoneMotionStatus.getDrivingRecordAnalysis", params), PhoneDrivingRecordAnalysisVo.class);
		return list;
	}
	
	/**
     * 查询行车记录分析图表
     * @param vo
     * @return
     * @throws Exception
     */
     @SuppressWarnings("unchecked")
	  @Transactional
     public  List<PhoneDrivingRecordAnalysisVo> searchRecordAnalysisChart(CommonParamsVo params)throws Exception {
          List<PhoneDrivingRecordAnalysisVo> list = PubUtil.convertListMapToObject(
        		  sqlMapDao.selectList("phoneMotionStatus.searchRecordAnalysisChart", params), PhoneDrivingRecordAnalysisVo.class);
          return list;
     }
}
